<template>
<view class="token-input">

  <view class="title">
    请输入EID token
  </view>

  <view style="margin-bottom: 60rpx">
    <input  @input="bindTokenInput" placeholder="请输入token" :value="inputToken"/>
  </view>

  <view @click='onConfirm'>
	  跳转到eID小程序
  </view>

</view>
</template>

<script>
const {startEid } = require('../../mp_ecard_sdk/main');

export default {
  data(){
    return {
      token: '',
    }
  },
  methods:{
    bindTokenInput(e) {
      console.log('dd',e)
        this.token = e.detail.value;
    },
    onConfirm() {
		console.log('调用了人脸识别')
      const param = {
        data: {
          token:this.token,
        },
        verifyDoneCallback(res) {
          const { token, verifyDone } = res;
		  console.log('收到核身完成的res:', res);
		  console.log('核身的token是:', token); 
		  console.log('是否完成核身:', verifyDone);  
        },
      };
      this.token && startEid(param);
    },
  }
}
</script>


<style>
.token-input {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* justify-content: center; */
}

input {
  margin-bottom: 40rpx;
  border:1px solid #ccc;
  width: 600rpx;
  height: 80rpx;
}

button {
  width: 622rpx !important;
  height: 96rpx !important;
  background-color: #198eea;
  color: #FFFFFF;
  border: 2rpx solid #DDDDDD;
  font-size: 32rpx;
  font-weight: normal !important;
  line-height: 96rpx !important;
}
</style>
